#include "RandomSelection.h"

void RandomSelection::select(Solution* &child1, Solution* &child2)
{
	
	int selection1 = int(MyRandom::randDbl() * genePool.size());
	int selection2 = int(MyRandom::randDbl() * genePool.size());
	
	child1 = genePool[selection1];
	child2 = genePool[selection2];
}

void RandomSelection::clean()
{
	genePool.clear();
}

void RandomSelection::prepare(vector<Solution*> newPool)
{
	clean();
	genePool = newPool;
}

Selection* RandomSelection::getSelection() {
    return new RandomSelection();
}
